package cn.tedu.luckydrawuser.config;

import cn.tedu.luckydrawuser.handler.UserLogHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.server.RouterFunction;
import static org.springframework.web.reactive.function.server.RouterFunctions.route;
import static org.springframework.web.reactive.function.server.RequestPredicates.GET;

@Configuration
public class UserLogRouter {
    /**
     * RouterFunction：用于声明如何将请求路由到处理器代码中
     * RequestPredicates：声明要处理的请求类型
     */
    @Bean
    public RouterFunction routerUserLog(UserLogHandler handler){
        return route(GET("/draw/user-log/findAll"),handler::findAll);
    }
}
